import 'package:flutter/material.dart';

class Background extends StatelessWidget {
  final Widget child;
  final String bgImage;
  const Background({
      Key? key,
      required this.child,
      required this.bgImage,
  }) : super (key: key);

  @override
  Widget build(BuildContext context) {
    // return Scaffold(
    //
    //   body: SizedBox(
    //     width: double.infinity,
    //     height: double.infinity,
    //     child: Container(
    //       decoration: BoxDecoration(
    //         color: Colors.yellow,
    //       ),
    //       child: Icon(Icons.autorenew),
    //     ),
    //   ),
    // );
    return Container(
      child: child,
      decoration: BoxDecoration(
          image: DecorationImage(
              image: AssetImage(bgImage),
              fit: BoxFit.fill
          )
      ),
    );
  }
}